import { director } from "cc";
import { Director } from "cc";
import { System } from "cc";
import { EventDispatcher } from "./EventDispatcher";

export enum NSystemEvent{
    UPDATE = "NSystemEvent_UPDATE"
}

export default class NSystem extends System {

    static KEY = "NSystem";
    static _ins:NSystem;
    static getIns():NSystem{
        return this._ins || (this._ins = new NSystem);
    }

    static{
        NSystem.getIns();
    }

    constructor(){
        super();
        director.registerSystem(NSystem.KEY,this,0);
    }

    update(dt: number): void {
        EventDispatcher.getIns().emit(NSystemEvent.UPDATE,dt);
    }

}


